import jsonpath

from src.api.author import sample, dept, author, goods, colonel


def case_03_data():
    """

    """
    """员工信息"""
    users_list_res = dept.users_list()
    user_info = jsonpath.jsonpath(users_list_res, f"$..data[0]")[0]
    user_id = jsonpath.jsonpath(users_list_res, f"$..data[0]..user_id")[0]
    """团长信息"""
    colonel_list_res = colonel.simple_list()
    colonel_info = jsonpath.jsonpath(colonel_list_res, f"$..list[0]")[0]

    """商品信息"""
    # goods_list_res = goods.list(author_id=author_id, resource=9)
    # products = jsonpath.jsonpath(goods_list_res, f"$..list[2]")[0]
    products = {
        "shop_id": "",
        "shop_name": "",
        "activity_id": "",
        "product_id": "#10400000101",
        "product_title": "",
        "sku_info": [
            {
                "name": "#测试#PA02202-焦糖色牛头层革/女鞋",
                "spec_items": [
                    {
                        "id": "172393",
                        "name": "#测试#PA02202-焦糖色牛头层革/女鞋"
                    }
                ],
                "code": "#10400000101",
                "new_price": 19,
                "count": 1,
                "sku_id": 172393
            }
        ],
        "resource": 9,
        "repeat_info": [],
        "spu_id": 0
    }
    """收货地址"""
    receiver_info_text = "里斯17123324209北京市宣武区翻斗大街翻斗花园1001室"
    receive_res = sample.receiveInfo(receiver_info_text)
    receiver_info = jsonpath.jsonpath(receive_res, "$..data")[0]

    return products, receiver_info, user_info, colonel_info
